<<<<<<< HEAD
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Logout extends CI_Controller {
	
	function __construct(){
		parent::__construct();
		if(!isset($_SESSION)){
		    session_start();
		}
		$admin = $this->session->userdata('admin_user');
		if(!$admin || !isset($admin['user_id'])){
			header('Location: /sys_admin/login');
			exit;
		}
	}
	
	function index(){
		$this->load->library('session');
		$admin = $this->session->userdata('admin_user');
		 if($admin != null){
		 	$ns_key = $this->mycache->get("foo_bar");
		 	if($ns_key != null){
		 		$this->mycache->delete("foo_".$ns_key."_".$admin['id']);
		 	}
		 }
		$this->session->unset_userdata('admin_user');
		$this->session->sess_destroy();
		header('Location: /sys_admin/login');
	}
	
=======
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Logout extends CI_Controller {
    
	function __construct(){
		parent::__construct();
		if(!isset($_SESSION)){
		    session_start();
		}
		$admin = $this->session->userdata('admin_user');
		if(!$admin || !isset($admin['user_id'])){
			header('Location: /sys_admin/login');
			exit;
		}
	}
	
	function index(){
		$this->load->library('session');
		$admin = $this->session->userdata('admin_user');
		 if($admin != null){
		 	$ns_key = $this->mycache->get("foo_bar");
		 	if($ns_key != null){
		 		$this->mycache->delete("foo_".$ns_key."_".$admin['id']);
		 	}
		 }
		$this->session->unset_userdata('admin_user');
		$this->session->sess_destroy();
		header('Location: /sys_admin/login');
	}
	
>>>>>>> d47623b610d79a4eeb489500830c00d70933f414
}